﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.events.*;
    import org.robotlegs.core.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.views.components.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class BannerMediator extends Mediator implements IMediator {

		[Inject]
        public var banner:Banner;
		[Inject]
        public var language:LanguageModel;
		[Inject]
        public var userModel:UserModel;
		[Inject]
        public var friendsModel:FriendsModel;

        override public function onRegister():void{
            addContextListener(EventConstants.FRIENDS_MODEL_CHANGED, this.friendsModelChanged);
            this.banner.userTextfield.text = this.language.getTextByKey("global_username_gen");
        }
        private function friendsModelChanged(_arg1:Event):void{
            var _local2:String = this.userModel.visitingFriendID;
            var _local3:Object = this.friendsModel.getVisitingFriendObject(_local2);
            this.banner.userTextfield.text = this.language.getTextByKey("global_friendsname_gen", {friends_name:_local3.first_name});
        }

    }
}//package net.wooga.pets.views 
